package com.itao.controller;


import com.itao.config.NacosProperties;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author sjt
 * @CreateTime 2023/03/14 14:44
 */
@RestController
@RefreshScope
@RequiredArgsConstructor
public class NacosController {

    @Value("${server.port}")
    private int port;
    @Value("${config.mes}")
    private String mes;
    private final NacosProperties properties;

    @GetMapping("/nacos")
    public String nacos() {
        return "nacos" + port;
    }

    @GetMapping("/mes")
    public String mes(){
        return mes;
    }

    @GetMapping("/properties")
    public NacosProperties properties(){
        return properties;
    }
}
